<me:UIGSDAT x:Class="WPFExcelReport.TGSPR"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL"  
                     xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"
                    xmlns:GM="clr-namespace:WPFExcelReport;assembly=TGSMATK"  
                        xmlns:GC="clr-namespace:WPFExcelReport;assembly=TGSCOLOR"  
             xmlns:DR="clr-namespace:WPFExcelReport;assembly=TDRAUFTR" 
                    xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT"  
                     xmlns:Localization="clr-namespace:Localization;assembly=Localization"
                     Loaded="Window_Loaded"
                    FontSize="16"
                    IsPage="True"
                    Rows="100"
                     x:Name="TV" 
     >
    <me:UIGSDAT.Resources>
        <CollectionViewSource  x:Key="vwMaster"  />
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:NOTBoolToVisibilityConverter x:Key="nbv"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby10000  x:Key="dw"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:PreisConverter  x:Key="PreisConverter"/>
        <ucd:PNumConverter  x:Key="pnum"/>
        <ucd:TextTrimmingConverter  x:Key="Trim"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:NOTBoolToVisibilityConverter  x:Key="not"/>
    </me:UIGSDAT.Resources>
    <Grid  >
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="1*"/>
            <RowDefinition Height="Auto"/> 
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*"/>
            <ColumnDefinition Width="Auto"/>
        </Grid.ColumnDefinitions>
        <StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2">
            <WrapPanel Margin="10,10,0,0" >
                <Button  Click="EditCommand" Width="24" Height="20"
                             Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource nbv}}"
                             >
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/Edit.png" />
                    </Button.Background>
                </Button>
                <Button   Click="SaveCommand" Height="20" Margin="5,0,0,0" Width="24" Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource bv}}" >
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/Save.png" />
                    </Button.Background>
                </Button>
                <Grid Margin="10,0,0,0" VerticalAlignment="Top">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <DR:TDRAUFTR  Grid.Column="0" Name="cDR"  Visibility="Collapsed"
                                           VerticalAlignment="Top"
                                          DocType="{Binding VALBTYP,ElementName=TV}" 
                                          PrintType="OpenExcel" />
                    <Button  Grid.Column="1"   Click="ImportExcel" Height="20" Margin="5,0,0,0" 
                             Width="Auto" Content="{Binding Source={Localization:Translate Word=导入}}" />
                </Grid>
            </WrapPanel>
            <WrapPanel Margin="10,10,0,0">
                    <TextBlock Text="{Binding Source={Localization:Translate Word=纱线规格}}"/>
                    <ex:TXT72 Text="{Binding ART,ElementName=TV}" MaxLength="20" CharacterCasing="Upper" Width="200" /> 
                   
                    <TextBlock Text="{Binding Source={Localization:Translate Word=描述}}"/>
                    <ex:TXT72 Text="{Binding DES,ElementName=TV,Converter={StaticResource gb2312}}" MaxLength="20" CharacterCasing="Upper" Width="200" />
                    <Button  Click="QueryCommand" Height="20" Margin="5,0,0,0" Width="24" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Search.png" />
                        </Button.Background>
                    </Button> 
            </WrapPanel>
            <WrapPanel Margin="10,10,0,0">
                <TextBlock   Text="{Binding Source={Localization:Translate Word=含税价格:}}"/>
                <ex:NumericBox   Margin="20,0,0,0"   Text="{Binding GSKGPR,ElementName=TV,Converter={StaticResource ResourceKey=dw}}" Width="160"  
                                 DecimalPlaces="6"
                                    IsReadOnly="{Binding IsEdit,Converter={StaticResource not}}"/>
                <TextBlock   Text="{Binding Source={Localization:Translate Word=元/KG}}"/>
                <TextBlock   Margin="20,0,0,0"   Text="{Binding GSBWPR1,Converter={StaticResource ResourceKey=dw}}" 
                             Width="60"  
                              />
                <TextBlock   Text="{Binding Source={Localization:Translate Word=经纱价格}}"/>
                <TextBlock   Margin="20,0,0,0"   Text="{Binding GSBWPR2,Converter={StaticResource ResourceKey=dw}}" 
                             Width="60"  
                              />
                <TextBlock   Text="{Binding Source={Localization:Translate Word=纬纱价格}}"/>
                <TextBlock   Margin="20,0,0,0"   Text="{Binding GSBWPR3,Converter={StaticResource ResourceKey=dw}}" 
                             Width="60"  
                              />
                <TextBlock   Text="{Binding Source={Localization:Translate Word=元/吨}}"/>
            </WrapPanel>
        </StackPanel>
        <DataGrid   Grid.Row="1"   Grid.Column="0"   
                   VerticalAlignment="Top"  
                   AutoGenerateColumns="False"
                   EnableRowVirtualization="False"
                   IsReadOnly="True"
                   VerticalScrollBarVisibility="Auto"
                   HorizontalScrollBarVisibility="Auto"
                   HeadersVisibility="Column"   
                   ItemsSource="{Binding Source={StaticResource ResourceKey=vwMaster}}" 
                   IsSynchronizedWithCurrentItem="True" 
                   x:Name="dlgMaster"  
                   RowDetailsVisibilityMode="Visible"  
                    >
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Path=GSART,Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=纱线规格}}"  Width="150" />
                <DataGridTextColumn Binding="{Binding Path=GSHANDLNR,Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=描述}}"  Width="150" />
                <DataGridTextColumn Binding="{Binding Path=GSNUMART}" Visibility="Collapsed" Header="{Binding Source={Localization:Translate Word=纱支类型}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=GSGARNNR,Converter={StaticResource ResourceKey=dw}}" Header="{Binding Source={Localization:Translate Word=纤度}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=GSFACH}" Header="{Binding Source={Localization:Translate Word=孔数}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=GSRECHNUM}" Visibility="Collapsed" Header="{Binding Source={Localization:Translate Word=计算}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=GSRECHNR,Converter={StaticResource ResourceKey=dw}}" Visibility="Collapsed" Header="{Binding Source={Localization:Translate Word=纱支}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=GSBWPR1,Converter={StaticResource ResourceKey=dw}}" Header="{Binding Source={Localization:Translate Word=价格}}" Foreground="Red" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=GSBWPR2,Converter={StaticResource ResourceKey=dw}}" Header="{Binding Source={Localization:Translate Word=经纱价格}}" Foreground="Red" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=GSBWPR3,Converter={StaticResource ResourceKey=dw}}" Header="{Binding Source={Localization:Translate Word=纬纱价格}}" Foreground="Red" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=GSAENDBEN}" Header="{Binding Source={Localization:Translate Word=修改}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=GSAENDDAT}" Header="{Binding Source={Localization:Translate Word=日期}}"  Width="Auto" /> 
                <DataGridTextColumn Binding="{Binding Path=GSNEUBEN }" Header="{Binding Source={Localization:Translate Word=新建}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=GSNEUDAT}" Header="{Binding Source={Localization:Translate Word=日期}}"  Width="Auto" />

            </DataGrid.Columns>
        </DataGrid>
        <ex:TPage  Grid.Row="2"  Grid.Column="0"   
                   Visibility="{Binding IsPage,Converter={StaticResource bv}}"/> 
        
    </Grid>
</me:UIGSDAT>
